package com.gopay.common.domain.cust;

import com.gopay.common.domain.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.util.Date;

/**
 * @author jianglijun
 * @ClassName: CustSettledInfo
 * @Description: 商户入驻信息表
 * @date 2016年11月17日 下午3:57:35
 */
@Entity
@Table(name = "CUST_SETTLED_INFO")
public class CustSettledInfo extends BaseEntity {

    private static final long serialVersionUID = -1220418318849840046L;

    private Long id;
    private String custId;
    private String type;
    private String channel;
    private String merchantCode;
    private String bankMerchantCode;
    private String category;
    private String stat;
    private String errorMsg;
    private Date createdTs;
    private String createOperId;
    private String lastUpdOperId;
    private String payKey;
    private Date lastUpdTs;
    private int version;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CUST_SETTLED_INFO_SEQ")
    @SequenceGenerator(name = "CUST_SETTLED_INFO_SEQ", allocationSize = 1, initialValue = 1, sequenceName = "CUST_SETTLED_INFO_SEQ")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    @Column(name = "CUST_ID", nullable = false, length = 10)
    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name = "TYPE", length = 32)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "CHANNEL", nullable = false, length = 32)
    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    @Column(name = "MERCHANT_CODE", nullable = false, length = 12)
    public String getMerchantCode() {
        return merchantCode;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    @Column(name = "BANK_MERCHANT_CODE", length = 32)
    public String getBankMerchantCode() {
        return bankMerchantCode;
    }

    public void setBankMerchantCode(String bankMerchantCode) {
        this.bankMerchantCode = bankMerchantCode;
    }

    @Column(name = "CATEGORY", nullable = false, length = 32)
    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    @Column(name = "STAT", length = 2)
    public String getStat() {
        return stat;
    }

    public void setStat(String stat) {
        this.stat = stat;
    }

    @Column(name = "ERROR_MSG", length = 256)
    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Column(name = "CREATED_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "CREATE_OPER_ID", length = 10)
    public String getCreateOperId() {
        return createOperId;
    }

    public void setCreateOperId(String createOperId) {
        this.createOperId = createOperId;
    }

    @Column(name = "LAST_UPD_OPER_ID", length = 10)
    public String getLastUpdOperId() {
        return lastUpdOperId;
    }

    public void setLastUpdOperId(String lastUpdOperId) {
        this.lastUpdOperId = lastUpdOperId;
    }

    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "CustSettledInfo{" +
                "id=" + id +
                ", custId='" + custId + '\'' +
                ", type='" + type + '\'' +
                ", channel='" + channel + '\'' +
                ", merchantCode='" + merchantCode + '\'' +
                ", bankMerchantCode='" + bankMerchantCode + '\'' +
                ", category='" + category + '\'' +
                ", stat='" + stat + '\'' +
                ", errorMsg='" + errorMsg + '\'' +
                ", createdTs=" + createdTs +
                ", createOperId='" + createOperId + '\'' +
                ", lastUpdOperId='" + lastUpdOperId + '\'' +
                ", lastUpdTs=" + lastUpdTs +
                ", version=" + version +
                ", payKey=" + payKey +
                '}';
    }

	/**
	 * @return 返回 payKey。
	 */
    @Column(name = "PAY_KEY", length = 100)
	public String getPayKey() {
		return payKey;
	}

	/**
	 * @param payKey 要设置的 payKey。
	 */
	public void setPayKey(String payKey) {
		this.payKey = payKey;
	}
}
